/**
 * Title: ManageService
 * Description:
 * <p>
 * Company: Amumu系统
 * Copyright: Copyright (c) 2017
 * All right reserved.
 * Created by WangXuDong on 2017/8/18.
 *
 * @author WangXuDong
 * @version 1.0
 */
package cn.com.wxd.amumu.search.service;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.com.wxd.amumu.search.IndexConfig;
import cn.com.wxd.amumu.search.core.IndexFile;
import cn.com.wxd.amumu.search.entity.IndexEntity;

/**
 * Title:
 * Description:
 * <p>
 * Company: Amumu系统
 * Copyright: Copyright (c) 2017
 * All right reserved.
 * Created by WangXuDong on 2017/8/18.
 *
 * @author WangXuDong
 * @version 1.0
 */
@Service
public class ManageService {
    private IndexFile indexFile = new IndexFile();

    public void addData(List<IndexEntity> indexEntitylist) throws Exception {
        indexFile.buildIndex(indexEntitylist, IndexConfig.INDEXPATH);
    }

    public void updateData(IndexEntity indexEntity) throws Exception {
        indexFile.update(indexEntity, IndexConfig.INDEXPATH);
    }

    public void delData(String[] indexId) throws Exception {
        indexFile.deleteIndex(indexId, IndexConfig.INDEXPATH);
    }
}
